﻿<%@ Page Title="" Language="C#" MasterPageFile="~/OpenGado.Master" AutoEventWireup="true" CodeBehind="UnitofMeasureForm.aspx.cs" Inherits="OpenGado.UnitofMeasureForm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 115px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <asp:Panel ID="pnlForm" runat="server" Height="358px">
            <br />
            test<table style="width:100%;">
                <tr>
                    <td class="style1">
                        &nbsp;</td>
                    <td>
                        Unit of Measure<asp:HiddenField ID="txtUnitId" runat="server" />
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style1">
                        Unit of Measure</td>
                    <td>
                        <asp:TextBox ID="txtUnit" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style1">
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="Save" />
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </asp:Panel>

    <asp:Panel ID="pnlList" runat="server" Height="549px" Width="454px">
        <asp:HyperLink ID="lblNew" runat="server" 
            NavigateUrl="~/UnitofMeasureForm.aspx?action=add">Add New</asp:HyperLink>
       
        <asp:ListView ID="lvUnit" runat="server" DataSourceID="dsList" 
            EnableModelValidation="True">
            <AlternatingItemTemplate>
                <li style="background-color: #FFF8DC;">Id:
                    <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                    <br />
                    Name:
                    <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
                    <br />
                    <a href="UnitofMeasureForm.aspx?action=edit&&id=<%# Eval("Id") %>">Edit</a> | <a href="UnitofMeasureForm.aspx?action=delete&&id=<%# Eval("Id") %>">Delete</a>
             </li>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <li style="background-color: #008A8C;color: #FFFFFF;">Id:
                    <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                    <br />
                    Name:
                    <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
                    <br />
                    StorageHasProduct:
                    <asp:TextBox ID="StorageHasProductTextBox" runat="server" 
                        Text='<%# Bind("StorageHasProduct") %>' />
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </li>
            </EditItemTemplate>
            <EmptyDataTemplate>
                No data was returned.
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <li style="">Id:
                    <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>' />
                    <br />
                    Name:
                    <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
                    <br />
                  
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </li>
            </InsertItemTemplate>
            <ItemSeparatorTemplate>
                <br />
            </ItemSeparatorTemplate>
            <ItemTemplate>
                <li style="background-color: #DCDCDC;color: #000000;">Id:
                    <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                    <br />
                    Name:
                    <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
                    <br />
                     <a href="UnitofMeasureForm.aspx?action=edit&&id=<%# Eval("Id") %>">Edit</a> | <a href="UnitofMeasureForm.aspx?action=delete&&id=<%# Eval("Id") %>">Delete</a>
                 </li>
            </ItemTemplate>
            <LayoutTemplate>
                <ul ID="itemPlaceholderContainer" runat="server" 
                    style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                    <li runat="server" id="itemPlaceholder" />
                </ul>
                <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                </div>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <li style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">Id:
                    <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>' />
                    <br />
                    Name:
                    <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
                    <br />
                  
                </li>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:ObjectDataSource ID="dsList" runat="server" SelectMethod="GetAllUnits" 
            TypeName="OpenGado.Business.UnitOfMeasureBusiness"></asp:ObjectDataSource>
    </asp:Panel>
</asp:Content>
